Python Game Programming By Example by Paz Alejandro Rodas de & Howse Joseph
Author:Paz, Alejandro Rodas de & Howse, Joseph
Language: eng
Format: epub, azw3
Publisher: Packt Publishing
Published: 2015-09-27T16:00:00+00:00
Tip
Lighting and colors
When lighting is enabled, the colors are not determined by the glColor functions but by the combination of the lighting computation and the material colors set by glMaterial. To combine lighting with glColor, it is required that you enable GL_COLOR_MATERIAL first:
glEnable(GL_COLOR_MATERIAL) # ... glColor4f(r, g, b, a) # Draw polygons
Once we have initialized GLUT and enabled the GL capabilities, we complete our start() method by specifying the clear color, setting the perspective, and starting the main loop:
def start(self): # ... glClearColor(.1, .1, .1, 1) glMatrixMode(GL_PROJECTION) aspect = self.width / self.height gluPerspective(40., aspect, 1., 40.) glMatrixMode(GL_MODELVIEW) glutDisplayFunc(self.display) glutSpecialFunc(self.keyboard) glutMainLoop() def keyboard(self, key, x, y): pass
Download
Python Game Programming By Example by Paz Alejandro Rodas de & Howse Joseph.azw3
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12523)
Hello! Python by Anthony Briggs(9868)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9758)
The Mikado Method by Ola Ellnestam Daniel Brolund(9748)
Dependency Injection in .NET by Mark Seemann(9294)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8259)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7742)
Grails in Action by Glen Smith Peter Ledbrook(7668)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7518)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6746)
Microservices with Go by Alexander Shuiskov(6513)
Practical Design Patterns for Java Developers by Miroslav Wengner(6411)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6389)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6379)
Angular Projects - Third Edition by Aristeidis Bampakos(5769)
The Art of Crafting User Stories by The Art of Crafting User Stories(5300)
NetSuite for Consultants - Second Edition by Peter Ries(5244)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5062)
Kotlin in Action by Dmitry Jemerov(5020)
